package itcast.service.impl;

import itcast.dao.RepairDao;
import itcast.dao.impl.RepairDaoImpl;
import itcast.domain.Repair;
import itcast.service.RepairService;

import java.util.List;

public class RepairServiceImpl implements RepairService {
    RepairDao repairDao=new RepairDaoImpl();

   /* @Override
    public void addrepair_information(Repair repair) {
        repairDao.addrepair(repair);
    }*/
//添加数据
    @Override
    public void addrepair_information(String repair_date, String student_username, String student_name, String build_name, String drom_name, String repair_remark) {
        repairDao.addrepair(repair_date, student_username, student_name,  build_name, drom_name,  repair_remark);
    }

    //楼宇管理员查找维修数据

    @Override
    public List<Repair> findall() {
        return repairDao.findrepair();
    }
    //学生查找自身报修数据

    @Override
    public List<Repair> findStudentusernameRepair(String student_username) {
        return repairDao.findRepairStudent_username(student_username);
    }

    //根据报修id删除数据
    @Override
    public void deleteRepair(String id) {
        repairDao.delrepair(Integer.parseInt(id));
    }
}
